//
//  WmcMediaUploadResourceModel.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/6/9.
//

import Foundation
import YPNetwork

// MARK: - [WmcMediaUploadParameterModel]

class WmcMediaUploadParameterModel: YPNetworkJsonProtocol {
    // Lifecycle

    required init() {}

    // Internal

    /// 默认为宿主
    var appId: Int = YPWmcManager.shared.appId.yp.int
    
    /// 入口场景id
    var entryId: Int = 0

    /// 资源类型，0:图片，1视频，2音频
    var type: Int = 0

    /// 文件格式名
    var format: String = ""

    /// 城市
    var city: String?

    /// 地址详情
    var address: String?

    /// 水印相关扩展信息，2音频可以为空
    var wmcInfo: [String: Any]?
    
    /// 视频时长
    var videoTime: Int = 0
    
    /// 预览图路径
    var previewImagePath: String = ""
    
    /// 水印类型，2音频可以为空
    var wmId: Int?
    
    /// 拍摄时间 格式：yyyy-MM-dd HH:mm:ss
    var takeTime: String?
}

// MARK: - [WmcMediaUploadResourceParameterModel]

class WmcMediaUploadResourceParameterModel: WmcMediaUploadParameterModel {
    /// 鱼泡uid
    var uid: Int?

    /// http上传方式，0: put，1: post，默认是0
    var httpMethod: Int?
}

// MARK: - [WmcMediaUploadImageParameterModel]

class WmcMediaUploadImageParameterModel: WmcMediaUploadParameterModel {
    /// 相册类型，0：个人
    var albumType: Int = 0

    /// 用户id，albumType为0时是鱼泡用户id
    var busId: String = ""

    /// ip???
    var ip: String?
}

class WmcMediaCopyResourceParameterModel: WmcMediaUploadParameterModel {
    /// 资源唯一id
    var accessUrl: String = ""
    
    /// 授权复制的鉴权，生成规则详见：https://w3nu1yaadv.feishu.cn/wiki/wikcnAB4sEYQbUwL8QbXCbp5THf#
    var copSign: String = ""
}


// MARK: - [WmcMediaUploadResourceModel]

public struct WmcMediaUploadResourceModel: YPNetworkJsonProtocol {
    
    public init() {}

    /// 上传地址
    public var uploadUrl: String = ""

    /// 访问地址
    public var accessUrl: String = ""
    
    /// 资源相对地址
    public var url: String = ""

    /// 资源唯一id
    public var resourceId: String = ""

    /// map，上传时需要带给阿里云
    public var headers: [String: String] = [:]

    /// 上传过期时间，格式 2022-05-28 00:01:02
    public var uploadExpiredTime: String = ""
}
